<script lang="ts" setup>
import { onLaunch } from '@dcloudio/uni-app'
import { BASEURL } from '@/config'

// 初始化, 全局触发一次
onLaunch(() => {
	loadFontFace()
	isSafeArea()
})

// 是否有安全区
const isSafeArea = () => {
	uni.getSystemInfo({
		success: res => {
			uni.setStorageSync('isSafeArea', Boolean(res.safeAreaInsets.bottom))
		}
	})
}

// 加载字体
const loadFontFace = () => {
	uni.loadFontFace({
		family: 'PingFang-SC-Regular',
		global: true,
		source: `url("${BASEURL}/public/files/font/PingFang.ttf")`
	})
}
</script>

<style lang="scss">
@import "uview-plus/index.scss";
@import "static/iconfont-svg/iconfont-svg.css";
</style>
